﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace GDD2_Game3
{
    class GameDraw : IDraw
    {
		private Game1 game1;
		private GameData gameData;
        private SpriteBatch spriteBatch;
		private Texture2D vehicleTexture;
		private Texture2D wallTexture;

        public GameDraw(Game1 g1, GameData data, SpriteBatch sb, Texture2D vehicle, Texture2D wall)
        {
			game1 = g1;
			gameData = data;
			spriteBatch = sb;
			vehicleTexture = vehicle;
			wallTexture = wall;
        }

        public void draw(GameTime gameTime)
        {
			spriteBatch.Begin();
			spriteBatch.Draw(vehicleTexture, gameData.Vehicle.Box.Position, null, Color.White, gameData.Vehicle.Rotation, gameData.Vehicle.Box.Dimensions / 2.0f, 1.0f, SpriteEffects.None, 0);
            foreach (Wall wall in gameData.Track.Walls)
            {
				spriteBatch.Draw(wallTexture, wall.Box, Color.White);
            }
			spriteBatch.End();
        }
    }
}
